// var teamAgentURL = "http://localhost:8080/hjcr-wechat/user/getFirstAgent";
var teamAgentURL = "./json/teamAgent.json";
$(document).ready(function(){
  $.get(teamAgentURL,{
    params:{
      userId:sessionStorage.agentId
    }
  }, function(res){
    if(res.serviceResult){
      var data = res.resultParm.list;
      var info = res.resultParm.user;
      $(".name").text(info.userName);//姓名
      $(".num").text(res.resultParm.countFirstChildrenAgent);//代理人数
      $(".img").attr("src",info.headImgUrl);//
      $(".phone").text(info.userPhone);//积分
      var html = "";
      for (var i = 0; i < data.length; i++) {
        html +=   '<div class="option-item panel row">'+
            				'<img src="'+data[i].headImgUrl+'" class="avatar" alt="">'+
            				'<div class="user-info">'+
            					'<span class="username">'+data[i].userName+'</span>'+
            					'<br>'+
            					'<span class="text-color-1">手机号：'+data[i].userPhone+'</span>'+
            				'</div>'+
            			'</div>';
      }
      $(".option-panel").empty().append(html);
    }
  });
});
